﻿using System;
using System . Collections . Generic;
using System . Linq;
using System . Text;
using System . Threading . Tasks;
using System . Xml . Linq;

namespace GameClassLibrary . Banks
{
    public class Bank : GameObject
    {
        public double SavingInterestRateBase { get; set; }

        public double BorrowingInterestRateBase { get; set; }

        public double SavingInterestRateIncrease { get; set; }

        public double BorrowingInterestRateIncrease { get; set; }

        public SavingBankProof Deposit ( long money , TimeSpan takeTime )
        {

            return new SavingBankProof ( );
        }

        public override void NextDay ( )
        {
            throw new NotImplementedException ( );
        }

        public override XElement Save ( )
        {
            XElement temp=base.Save();

            temp . SetAttributeValue ( "SavingInterestRateBase" , SavingInterestRateBase );
            temp . SetAttributeValue ( "BorrowingInterestRateBase" , BorrowingInterestRateBase );
            temp . SetAttributeValue ( "SavingInterestRateIncrease" , SavingInterestRateIncrease );
            temp . SetAttributeValue ( "BorrowingInterestRateIncrease" , BorrowingInterestRateIncrease );

            return temp;
        }

        public Bank ( XElement saving ) : base ( saving )
        {
            SavingInterestRateBase = Convert . ToDouble ( saving . Attribute ( "SavingInterestRateBase" ) );
            BorrowingInterestRateBase = Convert . ToDouble ( saving . Attribute ( "BorrowingInterestRateBase" ) );
            SavingInterestRateIncrease = Convert . ToDouble ( saving . Attribute ( "SavingInterestRateIncrease" ) );
            BorrowingInterestRateIncrease = Convert . ToDouble ( saving . Attribute ( "BorrowingInterestRateIncrease" ) );
        }

    }
}
